<?php namespace App\Infra;

use App\Models\Order;
use App\Utils\ModelOperatorTrait;


class OrderManager{
	use ModelOperatorTrait;

	public function addOrder($data){
		$this->create(Order::class,$data);
	}

	public function getOrder($id){
		return Order::find($id);
	}

	public function getOrders($conditions = null,$first = false){
		return $this->findModel(Order::class,Order::query(),$conditions,$first);
	}

	public function updateOrder($id,$data){
		$this->update(Order::class,$id,$data);
	}
}